﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJ.Data.Inventory;
using PJ.Framework.Common;

namespace PJ.Business.Inventory
{
    /// <summary>
    /// InventoryItemBarCode class
    /// </summary>
    public class InventoryBarCode : Entity<IInventoryBarCodeData>, IInventoryBarCode
    {
        public InventoryBarCode()
        {
        }
        public InventoryBarCode(IInventoryBarCodeData data)
            : base(data)
        {
        }

        public override void CopyFrom(IBusinessObject data)
        {
            base.CopyFrom(data);
            IInventoryBarCode idata = data as IInventoryBarCode;
            if (idata == null)
                throw new ArgumentException();
            this.UnitId = idata.UnitId;
            this.Quantity = idata.Quantity;
        }


        public string OwnerId
        {
            get
            {
                return ObjectData.OwnerId;
            }
            set
            {
                ObjectData.OwnerId = value;
            }
        }

        public double Quantity
        {
            get
            {
                return ObjectData.Quantity;
            }
            set
            {
                ObjectData.Quantity = value;
            }
        }

        public string UnitId
        {
            get
            {
                return ObjectData.UnitId;
            }
            set
            {
                ObjectData.UnitId = value;
            }
        }
    }
}
